package com.lwt.controller;

import com.lwt.po.Picture;
import com.lwt.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @program: blog
 * @author: 关键我是大怪
 * @create: 2021-08-03 15:38
 */
@Controller
public class PictureShowController {
    @Autowired
    private PictureService pictureService;

    @GetMapping("/picture")
    public String picture(Model model) {
        List<Picture> pictures = pictureService.listPicture();
        model.addAttribute("pictures", pictures);
        return "picture";
    }
}
